<?php

  //connect to database
  @connectToDb($dbServer, $dbReadOnly, $dbReadOnlyPW, $dbName);
   
  //retrieves the password corresponding the staffID (login) and returns it back.
  function getStaffPassword($staff_no)
  {
    //some queries to find password and set it to staffPassword
    //if wrong password or staffid does not exist, return false
 
    $sql = "SELECT staff_password FROM staff_login WHERE staff_no = " . $staff_no;

    $sql_result = @mysql_query($sql);

    $sql_num = @mysql_numrows($sql_result);

    if($sql_num == 0)
    {
      return "";
    }
    else
    {
      $result = mysql_fetch_array($sql_result);
      return $result[0];
    }

  }

  function getDepartmentNo($user)
  {
    $sql = "SELECT staff_dep_no FROM staff WHERE staff_no = " . $user;

    $sql_result = @mysql_query($sql);

    $sql_num = @mysql_numrows($sql_result);

    if($sql_num == 0)
    {
      return "";
    }
    else
    {
      $result = mysql_fetch_array($sql_result);
      return $result[0];
    } 
  }

?>